namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0110 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.SysOTPData", "OTP_OtpId", "dbo.SysOTP");
            DropIndex("dbo.SysOTPData", new[] { "OTP_OtpId" });
            AddColumn("dbo.SysOTP", "EmpId", c => c.Int(nullable: false));
            AddColumn("dbo.SysOTP", "EmployeeFullName", c => c.String());
            AddColumn("dbo.SysOTP", "UserId", c => c.Int(nullable: false));
            AddColumn("dbo.SysOTP", "UserCode", c => c.String());
            AddColumn("dbo.SysOTP", "Height", c => c.Int());
            AddColumn("dbo.SysOTP", "WorkingJobSiteSeq", c => c.Int());
            AddColumn("dbo.SysOTP", "WorkingJobSiteName", c => c.String());
            AddColumn("dbo.SysOTP", "WorkAreaId", c => c.Int());
            AddColumn("dbo.SysOTP", "RedirectUrl", c => c.String());
            AddColumn("dbo.SysOTP", "CustomField1", c => c.String());
            AddColumn("dbo.SysOTP", "CustomField2", c => c.String());
            AddColumn("dbo.SysOTP", "CustomField3", c => c.String());
            DropTable("dbo.SysOTPData");
        }
        
        public override void Down()
        {
            CreateTable(
                "dbo.SysOTPData",
                c => new
                    {
                        OTPDataId = c.Int(nullable: false, identity: true),
                        Key = c.String(),
                        Value = c.String(),
                        OTP_OtpId = c.Int(),
                    })
                .PrimaryKey(t => t.OTPDataId);
            
            DropColumn("dbo.SysOTP", "CustomField3");
            DropColumn("dbo.SysOTP", "CustomField2");
            DropColumn("dbo.SysOTP", "CustomField1");
            DropColumn("dbo.SysOTP", "RedirectUrl");
            DropColumn("dbo.SysOTP", "WorkAreaId");
            DropColumn("dbo.SysOTP", "WorkingJobSiteName");
            DropColumn("dbo.SysOTP", "WorkingJobSiteSeq");
            DropColumn("dbo.SysOTP", "Height");
            DropColumn("dbo.SysOTP", "UserCode");
            DropColumn("dbo.SysOTP", "UserId");
            DropColumn("dbo.SysOTP", "EmployeeFullName");
            DropColumn("dbo.SysOTP", "EmpId");
            CreateIndex("dbo.SysOTPData", "OTP_OtpId");
            AddForeignKey("dbo.SysOTPData", "OTP_OtpId", "dbo.SysOTP", "OtpId");
        }
    }
}
